/**
 * @file wa_font.h
 * 
 */

#ifndef _WA_FONT_H
#define _WA_FONT_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "wa_conf.h"
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_misc.h"
/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/
typedef enum
{
    WA_FONT_TYPE_INSIDE,
    WA_FONT_TYPE_OUTSIDE,
}wa_font_type;


typedef struct _wa_font_struct
{
    uint32_t first_ascii;
    uint32_t last_ascii;
    uint8_t * bitmap;
    uint32_t * map;
    uint8_t * width;
    struct _wa_font_struct * next_page;
}wa_font_str;

typedef struct _wa_font
{
    wa_font_type type;

    uint8_t height_row;
    wa_font_str * first_page;

    uint8_t* (*get_bitmap_from_outside)(struct _wa_font* font, uint32_t letter);
    uint8_t (*get_width_from_outside)(struct _wa_font* font, uint32_t letter);
}wa_font;

/**********************
 * GLOBAL PROTOTYPES
 **********************/

uint8_t* wa_font_get_bitmap(wa_font* font_p, uint32_t letter);
uint8_t wa_font_get_width(wa_font* font_p, uint32_t letter);
uint8_t wa_font_get_height(wa_font* font_p);
void wa_font_get_str_size(int* width, int* height, uint8_t* str, wa_font* font_p, uint8_t row_space, uint8_t col_space);

/**********************
 *      MACROS
 **********************/


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
